.profile-page {
  font-family: "Arial", sans-serif;
  max-width: 3600px;
  margin: 0 auto;
  background-color: #f8f9fa;
  min-height: 100vh;
}

.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
}

/* 左侧边栏 */
.profile-sidebar {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 24px;
}

.user-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-avatar-container {
  position: relative;
  margin-bottom: 24px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.user-avatar-container:hover {
  transform: scale(1.05);
}

.user-avatar-container:hover .avatar-edit-badge {
  opacity: 1;
  transform: translateY(0);
}

.user-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.user-avatar:hover {
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.avatar-edit-badge {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: linear-gradient(135deg, #1a2a3a, #2c3e50);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  white-space: nowrap;
}

.avatar-error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  text-align: center;
}

.user-name {
  font-size: 28px;
  font-weight: 600;
  color: #1a2a3a;
  margin-bottom: 8px;
  text-align: center;
}

.user-gender {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
  padding: 6px 16px;
  background: linear-gradient(to right, #f0f2f5, #e9ecef);
  border-radius: 20px;
  display: inline-block;
}

.user-bio {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.6;
  max-width: 280px;
  padding: 0 16px;
}

.user-stats {
  width: 100%;
  margin-bottom: 14px;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.stat-item:hover {
  background-color: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  padding: 12px 8px;
}

.stat-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.stat-label {
  color: #666;
  font-size: 12px;
  font-weight: 500;
}

.stat-value {
  color: #1a2a3a;
  font-weight: 600;
  font-size: 14px;
}

.invite-code-item {
  margin-top: 12px;
}

.invite-code-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(to right, #f8f9fa, #f0f2f5);
  border-radius: 12px;
  max-width: 300px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.invite-code {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #1a2a3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-code-actions {
  display: flex;
  gap: 6px;
}

.invite-code-button {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.invite-code-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.invite-code-button.refresh {
  color: #3b82f6;
}

.invite-code-button.copy {
  color: #10b981;
}

.refresh-icon,
.copy-icon {
  font-size: 16px;
}

.copy-success {
  position: absolute;
  right: 0;
  top: -28px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  animation: fadeInOut 2s ease-in-out;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.group-buttons {
  width: 100%;
  margin-top: 8px;
}

.edit-button {
  width: 100%;
  background: linear-gradient(135deg, #1a2a3a, #2c3e50);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  margin: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(26, 42, 58, 0.2);
}

.edit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 42, 58, 0.3);
}

.ban-button {
  width: 100%;
  background: #c61717;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  margin: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(26, 42, 58, 0.2);
}

.ban-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 42, 58, 0.3);
}

/* 主要内容区域 */
.profile-content {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.profile-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(to right, #f8f9fa, #ffffff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tab-button {
  padding: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
  position: relative;
}

.tab-button:hover {
  color: #1a2a3a;
  background-color: rgba(0, 0, 0, 0.02);
}

.tab-button.active {
  color: #1a2a3a;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a2a3a, #3b82f6);
}

.tab-content {
  padding: 24px;
}

.collection-count {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
}

/* 下载记录表格 */
.downloads-table {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.downloads-table table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.downloads-table th,
.downloads-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.downloads-table th {
  font-weight: 600;
  color: #1a2a3a;
  background: linear-gradient(to right, #f8f9fa, #ffffff);
}

.downloads-table tr:hover {
  background-color: rgba(59, 130, 246, 0.02);
}

.download-title-cell {
  max-width: 300px;
}

.download-title-with-image {
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.action-button {
  background: #f8f9fa;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  margin-right: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-button:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

.action-button.delete {
  background: #fee2e2;
  color: #dc2626;
}

.action-button.delete:hover {
  background: #fecaca;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  gap: 8px;
}

.page-button {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: white;
  cursor: pointer;
  padding: 0 12px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.page-button:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
}

.page-button.active {
  background: linear-gradient(135deg, #1a2a3a, #2c3e50);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(26, 42, 58, 0.2);
}

/* 加载和错误状态 */
.loading-state {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 14px;
}

.error-state {
  text-align: center;
  padding: 40px;
  color: #dc2626;
  font-size: 14px;
}

.retry-button {
  background: linear-gradient(135deg, #1a2a3a, #2c3e50);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(26, 42, 58, 0.2);
}

/* Modal样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #333;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.char-count {
  display: block;
  text-align: right;
  color: #666;
  font-size: 12px;
  margin-top: 4px;
}

.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.avatar-preview-container {
  position: relative;
  width: 100px;
  height: 100px;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e1e5e9;
  transition: all 0.3s ease;
}

.avatar-preview:hover {
  border-color: #3b82f6;
}

.avatar-uploading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
}

.uploading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.avatar-upload-controls {
  text-align: center;
  width: 100%;
}

.avatar-button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.avatar-upload-button,
.avatar-reset-button {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  border: none;
}

.avatar-upload-button {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.avatar-upload-button:hover:not(.disabled) {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
}

.avatar-upload-button.disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.avatar-reset-button {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.avatar-reset-button:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.avatar-upload-hint {
  color: #666;
  font-size: 12px;
  line-height: 1.4;
  max-width: 250px;
}

.file-info {
  margin-top: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e1e5e9;
}

.file-info small {
  color: #666;
  font-size: 11px;
  word-break: break-all;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e1e5e9;
}

.save-button,
.cancel-button {
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
}

.save-button {
  background: linear-gradient(135deg, #1a2a3a, #2c3e50);
  color: white;
}

.save-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  transform: translateY(-1px);
}

.save-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.cancel-button {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.cancel-button:hover:not(:disabled) {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.cancel-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .profile-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .profile-container {
    padding: 16px;
  }

  .user-avatar {
    width: 120px;
    height: 120px;
  }

  .user-name {
    font-size: 24px;
  }

  .user-stats {
    padding: 20px;
  }

  .downloads-table th:nth-child(2),
  .downloads-table td:nth-child(2),
  .downloads-table th:nth-child(3),
  .downloads-table td:nth-child(3) {
    display: none;
  }

  .modal-content {
    padding: 20px;
    margin: 20px;
  }

  .avatar-button-group {
    flex-direction: column;
    align-items: center;
  }

  .avatar-upload-button,
  .avatar-reset-button {
    width: 120px;
  }
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Right Sidebar */
.user-info-sidebar {
  background-color: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.info-title {
  font-weight: bold;
}

.edit-link {
  color: #3b82f6;
  font-size: 14px;
  cursor: pointer;
}

.info-avatar {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.info-avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

.info-details {
  margin-bottom: 16px;
}

.info-item {
  margin-bottom: 12px;
}

.info-label {
  color: #666;
  margin-bottom: 4px;
  display: block;
}

.radio-group {
  display: flex;
  gap: 16px;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-text {
  margin-left: 4px;
}

.bio-textarea {
  width: 100%;
  height: 100px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: none;
}

/* 上传标签页样式 */
.download-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.category-tag {
  background-color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.upload-time {
  color: #718096;
}

.download-description {
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.download-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.download-tags .tag {
  background-color: #edf2f7;
  color: #4a5568;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.status-completed {
  background-color: #c6f6d5;
  color: #22543d;
}

.status-pending {
  background-color: #fed7d7;
  color: #822727;
}
